﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="cn.ac.cintcm.sh.service.*,java.util.Iterator,cn.ac.cintcm.sh.domain.*" %>
<%
String fjId = request.getParameter("fjId");
PrescriptionService prescriptionService = new PrescriptionService();
Prescription p = prescriptionService.getPrescription(fjId);
Iterator iterator = p.getHerbs().iterator();
 %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="fj/pr/js/prContentOne.js"> </script>
</head>
<body onload="init();">
<script type="text/javascript">
var fjId="";
<%
if(fjId != null &&! (fjId = fjId.trim()).equals("")){
%>
fjId =<%=fjId %>;
<%
}%>
</script>

  <div id="content_div_ii" style="width:100%; height:100%" >
			 <div id="north_div">
			 <table border="0"   style="height:50px" cellpadding="0" cellspacing="0">
				  <tr>
				    <td> <font color="Turquoise"><%=p.getName()%></font>组成 &nbsp;
				    </td>
				  </tr>
				  <tr>
				    <td> &nbsp;
				    </td>
				  </tr>
				    <tr>
				  	<td  style="height:50px">
				  		<% 
				  		String s = p.getText();
				  		
				  		String r1 = "<a style=\"cursor:hand;color:blue\" href onmousedown=\"if(event.button == 2){PrHermenu(event,";
				  		String r2 = ");}\" >";
				  		String r3 = "</a>";
				  		int index = 0;
				  		while(iterator.hasNext()) {
				  			Herb herb = (Herb)iterator.next();
				  			String r = r1+herb.getId()+ r2 + herb.getName()+ r3;
				  			s = s.replace(herb.getName(), r);
						} 
						out.println(s);
						%>
				  		<br>
				  		</td>
				  </tr>
				  <tr>
				    <td valign="top">
				   
							   
				    </div> </td>
				  </tr>
			</table>
		</div>
			 <div id="prOnePan"></div>
		 </div>

</body>
</html>